package com.bjpowernode.service.impl;

import com.bjpowernode.dao.ProductDao;
import com.bjpowernode.service.ProductService;

public class ProductServiceImpl implements ProductService {

    private ProductDao productDao; // 存在于Spring实例容器中的类型
    private String name; // 简单数据类型：基本类型和String类型

    public ProductServiceImpl() {
    }

    public ProductServiceImpl(ProductDao productDao, String name) {
        this.productDao = productDao;
        this.name = name;
    }

    public void setProductDao(ProductDao productDao) {
        this.productDao = productDao;
    }

    public void setName(String name) {
        this.name = name;
    }

    public void save() {
        System.out.println(name);
        productDao.save();
    }
}
